package com.karolak.math.formula;

public class Sma {

	public static double calculate(double[] values) {
		if (values == null || values.length == 0) {
			return 0;
		}
		double total = Sum.calculate(values);
		int k = values.length;
		double sma = total / k;
		return sma;
	}
}